﻿using System;
using UnityEngine;

namespace DiverseStudents
{
    public static class DLog
    {
        const string pre = "[DLog] ";
        private static void PreAdd(ref string message)
        {
            message = pre + message;
        }

        public static void Log(string message)
        {
            if (!DConfig.logPrint) return;
            PreAdd(ref message);
            Debug.Log(message);
        }

        public static void Error(string message)
        {
            if (!DConfig.logPrint) return;
            PreAdd(ref message);
            Debug.LogError(message);
        }
        public static void Error(Exception e)
        {
            if (!DConfig.logPrint) return;
            var message = e.ToString();
            PreAdd(ref message);
            Debug.LogError(message);
        }

        public static void Warring(string message)
        {
            if (!DConfig.logPrint) return;
            PreAdd(ref message);
            Debug.LogWarning(message);
        }

    }
}
